package ch.ethz.inf.shop.model;

import java.sql.ResultSet;
import java.sql.SQLException;

import ch.ethz.inf.shop.Title;

/**
 * This class represents a Brand of products (i.e. Nestle, Barilla etc)
 */
public final class Brand {

	@Override
	public String toString() {
		return name;
	}

	@Title(text = "Brand Name", isVisible = true)
	private final String name;
	@Title(text = "Brand ID", isVisible = false)
	private final int brandId;

	public Brand(String name, int brandId) {
		super();
		this.name = name;
		this.brandId = brandId;
	}

	public Brand(final ResultSet rs) throws SQLException {
		this.brandId = rs.getInt("brand_id");
		this.name = rs.getString("brand_name");
	}

	public String getName() {
		return name;
	}

	public int getBrandId() {
		return brandId;
	}

}
